import { Part, ProcessDetail } from "./MomData";

export interface JobPart {
  jobOrderProcessPartId?: number; //工单工序物料ID
  partId: number; //物料ID
  partNumber: number; //物料序号
  partNum: string; //物料编码
  partName: string; //物料名称
  unitUsage: number; //单位用量
  lossRate: number; //损耗率
  fixedLoss: number; //固定损耗
  unit: string; //单位
  partType?: string; //物料类型
  partUOM?: string; //物料单位
  isFixedQuantity: boolean; //是否为固定数量
  requirementQuantity: number | null; //需求数量
  requirementUnit: string; //需求单位
  isPercentage: boolean; //是否为百分比
  issuedQuantity: number | null; //已发数量 默认0
  issuedUnit: string; //已发单位
  isIssueFinished: boolean; //是否发料完成 默认false
  partNote: string; //物料描述
}

export interface JobOrderProcess extends ProcessDetail{
  jobOrderProcessId: number;
  processNum: string;
  processId: number;
  processName: string;
  processNumber: number;
  productionQuantity: number;
  standardWorkingHours: number;
  workingHoursUnit: string;
  isFinished: boolean;
  isAssign: boolean,
  isIssue: boolean,
  isStart: boolean,
  reportedAmount: number;
  totalWorkingHours: number;
  processNote: string;
  planStartTime: Date;
  planFinishTime: Date;
  parts: JobPart[];
}

export interface ProductJobOrder {
  partId: number;
  jobNum: string;
  saleOrderNum: string;
  note: string;
  productNum: string;
  productName: string;
  momId: number;
  productionQuantity: number;
  jobOrderPlanStartDate: string;
  jobOrderPlanEndDate: string;
  orderPriority: number;
  jobOrderFile: string;
  jobOrderProcesses: JobOrderProcess[];
}
export enum FooterItems {
  TaskList = '工单队列',
  SOP = 'SOP',
  Rework = '返工',
  Andon = '安灯'
}

export interface ReportTask {
  jobOrderId: number;
  processId: number;
  qualifiedAmount: number;
  unqualifiedAmount: number;
  scrapAmount: number;
  positionId?: number;
}

export interface InspectionProject {
  inspectionProjectName: string;
  inspectionProjectDescription: string;
  inspectionProjectUnit: string;
  attachments: string[];
}

export interface ProductionInspectionOrder {
  productionInspectionOrderId: number;
  productionInspectionOrderNum: string;
  jobOrderProcessId: number;
  jobNum: string;
  processNum: string;
  procssName: string;
  inspectionType: string;
  productNum: string;
  productName: string;
  partType: string;
  momVersion: string;
  uom: string;
  pendingInspectionQuantity: number;
  inspectionStatus: string;
  qualifiedAmount: number;
  unqualifiedAmount: number;
  scrapAmount: number;
  inspectionProjects: InspectionProject[]; // 确保类型为 InspectionProject[]
  remarks: string;
  attachments: string[];
}
